// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package CustomerRelationsManagement;

/**
 *
 * @author Administrator
 */
public abstract class _orderDisp extends Ice.ObjectImpl implements order
{
    /**
     *
     * @param __obj
     * @throws java.lang.CloneNotSupportedException
     */
    protected void
    ice_copyStateFrom(Ice.Object __obj)
        throws java.lang.CloneNotSupportedException
    {
        throw new java.lang.CloneNotSupportedException();
    }

    /**
     *
     */
    public static final String[] __ids =
    {
        "::CustomerRelationsManagement::order",
        "::Ice::Object"
    };

    /**
     *
     * @param s
     * @return
     */
    public boolean
    ice_isA(String s)
    {
        return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    /**
     *
     * @param s
     * @param __current
     * @return
     */
    public boolean
    ice_isA(String s, Ice.Current __current)
    {
        return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    /**
     *
     * @return
     */
    public String[]
    ice_ids()
    {
        return __ids;
    }

    /**
     *
     * @param __current
     * @return
     */
    public String[]
    ice_ids(Ice.Current __current)
    {
        return __ids;
    }

    /**
     *
     * @return
     */
    public String
    ice_id()
    {
        return __ids[0];
    }

    /**
     *
     * @param __current
     * @return
     */
    public String
    ice_id(Ice.Current __current)
    {
        return __ids[0];
    }

    /**
     *
     * @return
     */
    public static String
    ice_staticId()
    {
        return __ids[0];
    }

    /**
     *
     * @throws CustomerRelationsManagement.DBError
     * @throws CustomerRelationsManagement.RecordNotCommitted
     */
    public final void
    delete()
        throws DBError,
               RecordNotCommitted
    {
        delete(null);
    }

    /**
     *
     * @return
     */
    public final int
    getCustomer()
    {
        return getCustomer(null);
    }

    /**
     *
     * @return
     */
    public final datetime
    getDeadline()
    {
        return getDeadline(null);
    }

    /**
     *
     * @return
     */
    public final String
    getDst()
    {
        return getDst(null);
    }

    /**
     *
     * @return
     * @throws CustomerRelationsManagement.RecordNotCommitted
     */
    public final int
    getId()
        throws RecordNotCommitted
    {
        return getId(null);
    }

    /**
     *
     * @return
     */
    public final String
    getSrc()
    {
        return getSrc(null);
    }

    /**
     *
     * @return
     */
    public final OrderStatus
    getStatus()
    {
        return getStatus(null);
    }

    /**
     *
     * @return
     */
    public final float
    getWeight()
    {
        return getWeight(null);
    }

    /**
     *
     * @throws CustomerRelationsManagement.DBError
     */
    public final void
    save()
        throws DBError
    {
        save(null);
    }

    /**
     *
     * @param CustomerId
     */
    public final void
    setCustomer(int CustomerId)
    {
        setCustomer(CustomerId, null);
    }

    /**
     *
     * @param deadline
     */
    public final void
    setDeadline(datetime deadline)
    {
        setDeadline(deadline, null);
    }

    /**
     *
     * @param dst
     */
    public final void
    setDst(String dst)
    {
        setDst(dst, null);
    }

    /**
     *
     * @param src
     */
    public final void
    setSrc(String src)
    {
        setSrc(src, null);
    }

    /**
     *
     * @param status
     */
    public final void
    setStatus(OrderStatus status)
    {
        setStatus(status, null);
    }

    /**
     *
     * @param weight
     */
    public final void
    setWeight(float weight)
    {
        setWeight(weight, null);
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getId(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        try
        {
            int __ret = __obj.getId(__current);
            __os.writeInt(__ret);
            return Ice.DispatchStatus.DispatchOK;
        }
        catch(RecordNotCommitted ex)
        {
            __os.writeUserException(ex);
            return Ice.DispatchStatus.DispatchUserException;
        }
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___save(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        try
        {
            __obj.save(__current);
            return Ice.DispatchStatus.DispatchOK;
        }
        catch(DBError ex)
        {
            __os.writeUserException(ex);
            return Ice.DispatchStatus.DispatchUserException;
        }
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___delete(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        try
        {
            __obj.delete(__current);
            return Ice.DispatchStatus.DispatchOK;
        }
        catch(DBError ex)
        {
            __os.writeUserException(ex);
            return Ice.DispatchStatus.DispatchUserException;
        }
        catch(RecordNotCommitted ex)
        {
            __os.writeUserException(ex);
            return Ice.DispatchStatus.DispatchUserException;
        }
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getCustomer(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        int __ret = __obj.getCustomer(__current);
        __os.writeInt(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setCustomer(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        int CustomerId;
        CustomerId = __is.readInt();
        __is.endReadEncaps();
        __obj.setCustomer(CustomerId, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getSrc(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        String __ret = __obj.getSrc(__current);
        __os.writeString(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getDst(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        String __ret = __obj.getDst(__current);
        __os.writeString(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setSrc(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        String src;
        src = __is.readString();
        __is.endReadEncaps();
        __obj.setSrc(src, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setDst(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        String dst;
        dst = __is.readString();
        __is.endReadEncaps();
        __obj.setDst(dst, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getWeight(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        float __ret = __obj.getWeight(__current);
        __os.writeFloat(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setWeight(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        float weight;
        weight = __is.readFloat();
        __is.endReadEncaps();
        __obj.setWeight(weight, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getDeadline(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        datetime __ret = __obj.getDeadline(__current);
        __ret.__write(__os);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setDeadline(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        datetime deadline;
        deadline = new datetime();
        deadline.__read(__is);
        __is.endReadEncaps();
        __obj.setDeadline(deadline, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___getStatus(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        OrderStatus __ret = __obj.getStatus(__current);
        __ret.__write(__os);
        return Ice.DispatchStatus.DispatchOK;
    }

    /**
     *
     * @param __obj
     * @param __inS
     * @param __current
     * @return
     */
    public static Ice.DispatchStatus
    ___setStatus(order __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        OrderStatus status;
        status = OrderStatus.__read(__is);
        __is.endReadEncaps();
        __obj.setStatus(status, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    private final static String[] __all =
    {
        "delete",
        "getCustomer",
        "getDeadline",
        "getDst",
        "getId",
        "getSrc",
        "getStatus",
        "getWeight",
        "ice_id",
        "ice_ids",
        "ice_isA",
        "ice_ping",
        "save",
        "setCustomer",
        "setDeadline",
        "setDst",
        "setSrc",
        "setStatus",
        "setWeight"
    };

    /**
     *
     * @param in
     * @param __current
     * @return
     */
    public Ice.DispatchStatus
    __dispatch(IceInternal.Incoming in, Ice.Current __current)
    {
        int pos = java.util.Arrays.binarySearch(__all, __current.operation);
        if(pos < 0)
        {
            throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
        }

        switch(pos)
        {
            case 0:
            {
                return ___delete(this, in, __current);
            }
            case 1:
            {
                return ___getCustomer(this, in, __current);
            }
            case 2:
            {
                return ___getDeadline(this, in, __current);
            }
            case 3:
            {
                return ___getDst(this, in, __current);
            }
            case 4:
            {
                return ___getId(this, in, __current);
            }
            case 5:
            {
                return ___getSrc(this, in, __current);
            }
            case 6:
            {
                return ___getStatus(this, in, __current);
            }
            case 7:
            {
                return ___getWeight(this, in, __current);
            }
            case 8:
            {
                return ___ice_id(this, in, __current);
            }
            case 9:
            {
                return ___ice_ids(this, in, __current);
            }
            case 10:
            {
                return ___ice_isA(this, in, __current);
            }
            case 11:
            {
                return ___ice_ping(this, in, __current);
            }
            case 12:
            {
                return ___save(this, in, __current);
            }
            case 13:
            {
                return ___setCustomer(this, in, __current);
            }
            case 14:
            {
                return ___setDeadline(this, in, __current);
            }
            case 15:
            {
                return ___setDst(this, in, __current);
            }
            case 16:
            {
                return ___setSrc(this, in, __current);
            }
            case 17:
            {
                return ___setStatus(this, in, __current);
            }
            case 18:
            {
                return ___setWeight(this, in, __current);
            }
        }

        assert(false);
        throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
    }

    /**
     *
     * @param __os
     */
    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeTypeId(ice_staticId());
        __os.startWriteSlice();
        __os.endWriteSlice();
        super.__write(__os);
    }

    /**
     *
     * @param __is
     * @param __rid
     */
    public void
    __read(IceInternal.BasicStream __is, boolean __rid)
    {
        if(__rid)
        {
            __is.readTypeId();
        }
        __is.startReadSlice();
        __is.endReadSlice();
        super.__read(__is, true);
    }

    /**
     *
     * @param __outS
     */
    public void
    __write(Ice.OutputStream __outS)
    {
        Ice.MarshalException ex = new Ice.MarshalException();
        ex.reason = "type CustomerRelationsManagement::order was not generated with stream support";
        throw ex;
    }

    /**
     *
     * @param __inS
     * @param __rid
     */
    public void
    __read(Ice.InputStream __inS, boolean __rid)
    {
        Ice.MarshalException ex = new Ice.MarshalException();
        ex.reason = "type CustomerRelationsManagement::order was not generated with stream support";
        throw ex;
    }
}
